import { Injectable, HttpException, HttpStatus } from '@nestjs/common';
import tableList from './data/table';
import req from '../common/request';
import { mock } from '../common/mock';

const biger = (arr: any[], num) => {
  const res = [];
  for (let i = 0; i < num; i++) {
    res.push(arr[0]);
  }
  return res;
};

@Injectable()
export class TableService {
  getTable(page: number, limit: number) {
    return req.res(biger(tableList, 20));
    if (page) return req.res(tableList);
    else return req.err('不存在id');
    throw new HttpException('Forbidden', HttpStatus.BAD_REQUEST);
  }
}
